<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <div>
            <!-- 禁止跳转 -->
            <a href="http://www.baidu.com" @click.prevent="show">跳转到百度</a>
        </div>
        <hr />
        <!-- 冒泡 -->
        <div style="height: 150px;background-color: orange;padding-left: 100px;line-height: 150px;" @click="divHandler">
            <button @click.stop="btnHandler">按钮</button>
        </div>
    </div>
    <script src="./lib/vue.js"></script>
    <script>
        const vm = new Vue({
            el: '#app',
            data: {

            },
            methods: {
                show(e) {
                    console.log('点击了链接')
                },
                btnHandler(e) {
                    // e.stopPropagation();
                    console.log("btnHandler");
                },
                divHandler() {
                    console.log("divHandler");
                }
            }
        })
    </script>
</body>

</html>